const onscroll = function (page, callback) {
    // var that = this;
    // scrollTop 滚动条滚动时，距离顶部的距离
    var scrollTop =
        document.documentElement.scrollTop || document.body.scrollTop;
    // windowHeight 可视区的高度
    var windowHeight =
        document.documentElement.clientHeight || document.body.clientHeight;
    // scrollHeight 滚动条的总高度
    var scrollHeight =
        document.documentElement.scrollHeight || document.body.scrollHeight;
    // 滚动条到底部的条件
    // console.log('scrollTop', scrollTop);
    // console.log('windowHeight', windowHeight);
    // console.log('scrollHeight', scrollHeight);
    if (scrollTop + windowHeight >= scrollHeight) {
        // 加载数据
        callback(page);
    }
}

export default onscroll